import time
from selenium import webdriver

driver = webdriver.Chrome()
driver.get('https://www.baidu.com/')

# TODO 执行js代码
js = 'alert(11111)'
driver.execute_script(js)

# 退出浏览器
time.sleep(2)
driver.quit()